const {resolve}=require('path')
const HtmlWebpackPlugin=require('html-webpack-plugin')
module.exports={
    entry:'./src/index.js',
    output:{
        filename:'built.js',
        path:resolve(__dirname,'build')
    },
    module:{
        rules:[
            {
                test:/\.css$/,
                use:['style-loader','css-loader']
            },
            {
                test:/\.(jpg|png|gif)$/,
                // loader:'url-loader',
                type:'asset',
                // options:{
                //     esMoudle:false
                // }
            },
            {
                exclude:/\.(css|js|html)$/,
                type:'asset/resource',
               
            }
        ]
    },
    plugins:[
        new HtmlWebpackPlugin({
            template:'./src/index.html'
        })
    ],
    mode:'development',
    devServer:{
        // contentBase:resolve(__dirname,'build'),
        compress:true,
        port:3001,
        open:true
    }
}